//输出通用axios实例
import axios from 'axios';
import qs from 'qs'
//formdata格式
const proposal = axios.create({
    headers: {
        'Content-Type': "application/x-www-form-urlencoded"
    }
});
//json格式
const proposalJson = axios.create({
    headers: {
        'Content-Type': "application/json"
    }
});

//后端地址
let baseApi = 'http://192.168.65.31:8093';
// let baseApi = 'http://192.168.65.126:8093';//陈世杰
// let baseApi = '/api4';

let reportbaseApi = 'http://192.168.65.15:8888';//15线上
// let reportbaseApi = 'http://192.168.65.126:8888';//陈世杰
// let reportbaseApi = '/api5';//

let reportbaseApi2 = 'http://192.168.65.15:9981';//15线上
// let reportbaseApi2 = '/api5';//193
//所有接口封装      
export default {
    async searchInfoValueBylocation(data) {
        return proposal.post(`http://192.168.65.15:8085/search/searchInfoValueBylocation?location=${data}`)
        // return proposal.post(`/api/search/searchInfoValueBylocation?location=${data}`);
    },
    async searchEnergyConsumptionByDay(data) {
        return proposal.post(baseApi + '/sys/VRawDataNewEqp/searchEnergyConsumptionByDay', data);
    },
    async searchRealTimeData(data) {
        return proposal.post(baseApi + '/sys/VRawDataNewEqp/searchRealTimeData', data);
    },
    async searchYesterdayData(data) {
        return proposal.post(baseApi + '/sys/VRawDataNewEqp/searchYesterdayData', data);
    },
    async searchYesterdayDataByEQ(data) {
        return proposal.post(baseApi + '/sys/VRawDataNewEqp/searchYesterdayDataByEQ', data);
    },
    async searchConsumeBy7Day(data) {
        return proposal.post(baseApi + '/sys/RawData/searchConsumeBy7Day', data);
    },
    async searchFactoryElectricityByTime(data) {
        return proposal.post(baseApi + '/sys/RawData/searchFactoryElectricityByTime', data);
    },
    //
    async searchEnergyConsumption(data) {
        return proposal.post(baseApi + '/sys/VRawDataNewEqp/searchEnergyConsumption', data);
    },
    async searchEnergyConsumptionTwo(data) {
        return proposal.post(baseApi + '/sys/VRawDataNewEqp/searchEnergyConsumptionTwo', data);
    },

    // 水接入
    async shuidataweek(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryT4WaterWeek', { timeDimension: "7" });
    },
    //单片能耗    周
    async queryYiledDay() {
        return proposalJson.post(reportbaseApi + '/electController/queryYiledDay', null);
    },

     //单片能耗    月
     async queryYiledMonth() {
        return proposalJson.post(reportbaseApi + '/electController/queryYiledMonth', null);
    },
    async shuidatamonth(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryT4WaterMonth', { timeDimension: "7" });
    },
    // 气接入
    async qidataweek(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryT4GasWeek', { timeDimension: "7" });
    },
    async qidatamonth(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryT4GasMonth', { timeDimension: "7" });
    },

    // T4机电科分析数据
    async queryElectricityAnalysis(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryElectricityAnalysis', { timeDimension: "7" });
    },
    //时间
    async returnDate(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/returnDate', { timeDimension: "7" });
    },
    //总能耗相关系数
    async queryCoefficient(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryCoefficient', { timeDimension: "7" });
    },
    //单片能耗系数
    async queryMonoliticCoefficient(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryMonoliticCoefficient', { timeDimension: "7" });
    },


    //查询机电电量
    async queryelectromechanicalElectricity(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryelectromechanicalElectricity', { timeDimension: "7" });
    },

    // 查询Hcda和lcda转化率
    async queryHcdaAndLcda(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryHcdaAndLcda', { timeDimension: "7" });
    },

    //bov占比分析
    async queryBovPercentage(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryBovPercentage', { timeDimension: "7" });
    },
    //高压压缩空气系统节能趋势分析
    async queryHcdaStartupSuggestion(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryHcdaStartupSuggestion', { timeDimension: "7" });
    },
    //低压压缩   
    async queryLcdaStartupSuggestion(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryLcdaStartupSuggestion', { timeDimension: "7" });
    },

    //低温冰水系统节能趋势分析   
    async queryLoweerStartupSuggestion(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryLoweerStartupSuggestion', { timeDimension: "7" });
    },
    //中温冰水系统节能趋势分析   
    async queryMiddleStartupSuggestion(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryMiddleStartupSuggestion', { timeDimension: "7" });
    },
    //HCDA高压压缩空气系统运行时长
    async queryHcdaRunTime(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryHcdaRunTime', { timeDimension: "7" });
    },
    //LCDA 低压压缩空气系统运行时长
    async queryLcdaRunTime(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryLcdaRunTime', { timeDimension: "7" });
    },
    //低温冰机运行时长
    async queryLowRunTime(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryLowRunTime', { timeDimension: "7" });
    },
    //中温冰机运行时长
    async queryMiddleRunTime(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryMiddleRunTime', { timeDimension: "7" });
    },


    //各科室报警分析描述
    async queryPoliceAnalysis(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryPoliceAnalysis', { timeDimension: "7" });
    },

    // T4机电科系统运行简报--PV压力曲线  
    async pvPressureCurve(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/pvPressureCurve', { timeDimension: "7" });
    },
    // T4机电科系统运行简报--CDA系统运行日报-CDA露点温度趋势
    async CDAdewPointTemperatureTrend(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/CDAdewPointTemperatureTrend', { timeDimension: "7" });
    },
    // T4机电科系统运行简报--CDA系统运行日报-CDA主管压力趋势
    async CDASupervisorPressure(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/CDASupervisorPressure', { timeDimension: "7" });
    },

    // T4机电科系统运行简报--CDA末端流量趋势分析-CDA
    async CDATerminusFlowCDA(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/CDATerminusFlowCDA', { timeDimension: "7" });
    },
    // T4机电科系统运行简报--CDA末端流量趋势分析-HCDA
    async CDATerminusFlowHCDA(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/CDATerminusFlowHCDA', { timeDimension: "7" });
    },
    // T4机电科系统运行简报--CDA末端流量趋势分析-LCDA
    async CDATerminusFlowLCDA(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/CDATerminusFlowLCDA', { timeDimension: "7" });
    },

    // CDA转化率趋势
    async ConversionRateTrend(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/ConversionRateTrend', { timeDimension: "7" });
    },
    // 排气系统运行日报-排气电量与运行台数-洁净科
    async exitGasNumberAndelectricity(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/exitGasNumberAndelectricity', { timeDimension: "7" });
    },

    // 排气静压-FAB一般排气静压-洁净科
    async FABStaticPressure(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/FABStaticPressure', { timeDimension: "7" });
    },
    // FMCS报警记录
    async fmcsAlarmRecord(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/fmcsAlarmRecord', { timeDimension: "7" });
    },
    // 主机BOV关闭度历史占比分析
    async hostBOVClosureDegree(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/hostBOVClosureDegree', { timeDimension: "7" });
    },

    //  机电科-冰水能耗报告 主机COP历史占比分析
    async HostCOPHistoricalProportion(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/HostCOPHistoricalProportion', { timeDimension: "7" });
    },
    // 洁净系统运行日报- FAB L40 湿度趋势
    async humidityTrend(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/humidityTrend', { timeDimension: "7" });
    },
    // 洁净系统运行日报-FAB L20 || 湿度趋势
    async humidityTrendFABLTwenty(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/humidityTrendFABLTwenty', { timeDimension: "7" });
    },

    //洁净科-MOD排气系统静压
    async queryModStaticPressure(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryModStaticPressure', { timeDimension: "7" });
    },

    // 洁净系统运行日报-用电量
    async kWh(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/kWh', { timeDimension: "7" });
    },
    // MAU系统运行日报-洁净科
    async kWhDewPointTemperature(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/kWhDewPointTemperature', { timeDimension: "7" });
    },
    // MAU外气状态分析-洁净科
    async MAUAnalysisOfExternalGasState(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/MAUAnalysisOfExternalGasState', { timeDimension: "7" });
    },

    // 机电科系统COP能效趋势分析
    async SystemEnergyEfficiencyTrendsc(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/SystemEnergyEfficiencyTrendsc', { timeDimension: "7" });
    },
    // T4水务二科系统运行简报-总排口指标浓度趋势
    async totalOutletConcentrationTrend(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/totalOutletConcentrationTrend', { timeDimension: "7" });
    },
    //  机电科:系统制冷负荷趋势分析
    async TrendAnalysisOfRefrigerationLoad(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/TrendAnalysisOfRefrigerationLoad', { timeDimension: "7" });
    },

    // T4水务二科系统运行简报-水务运营指标趋势
    async waterAffairsTrendOperationalIndicators(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/waterAffairsTrendOperationalIndicators', { timeDimension: "7" });
    },
    //高压科:年度碳排当量
    async queryCarbonEmission(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryCarbonEmission', { timeDimension: "7" });
    },
    //洁净科:排气电量与运行台数
    async exitGasNumberAndelectricity(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/exitGasNumberAndelectricity', { timeDimension: "7" });
    },

    //洁净科:fab特排系统静压
    async queryFabSpecial(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryFabSpecial ', { timeDimension: "7" });
    },

    //高低压科-厂务用电趋势
    async queryElectricityConsumptionTrend(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryElectricityConsumptionTrend', { timeDimension: "7" });
    },
    //高低压科-制程用电趋势
    async queryManufactyringProcess(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryManufactyringProcess', { timeDimension: "7" });
    },

    //高低压科-用电量及分项用电量,t4用电量及分项用电量
    async t4Ectricity(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/t4Ectricity', { timeDimension: "7" });
    },


    //机电科:中温冰机末端流量趋势分析
    async queryMiddleIceLastFlow(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryMiddleIceLastFlow', { timeDimension: "7" });
    },

    //高低压科:t4总能耗与外气干球温度趋势分析
    async queryEnergyConsumptionAndTemperature(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryEnergyConsumptionAndTemperature', { timeDimension: "7" });
    },

    //高低压科:t4单片能耗与外气干球温度趋势分析
    async queryMonolithic(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryMonolithic', { timeDimension: "7" });
    },

    //水务科:水单耗趋势
    async queryWaterHour(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryWaterHour', { timeDimension: "7" });
    },

    //cop占比分析
    async queryCopPercentage(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryCopPercentage', { timeDimension: "7" });
    },
    async queryElectMonth(data) {
        return proposalJson.post(reportbaseApi + '/electController/queryElectMonth', null);
    },

    async queryElectDay(data) {
        return proposalJson.post(reportbaseApi + '/electController/queryElectDay', null);
    },
    //
    //耗气量
    async qidataweek(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryT4GasWeek', { timeDimension: "7" });
    },
    //次数  /api/lkwr/outside/v2/queryAccessTimes
    async queryAccessTimes(data) {
        return proposalJson.post(reportbaseApi + '/api/lkwr/outside/v2/queryAccessTimes', { timeDimension: "7" });
    },
    // 首页水与建筑能耗
    async queryWaterAndElec(data) {
        return proposalJson.post(reportbaseApi + '/electController/queryWaterAndElec', null);
    },
    //厂端能耗报告

    //电
    async searchFactoryElectricityByTimes(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/searchFactoryElectricityByTimes', null);
    },
    //水
    async searchWeekToWater(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/waterResult/searchWeekToWater', null);
    },
    //气
    async searchWeekGas(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/GasResult/searchWeekGas', null);
    },
    //环比
    async queryRingRatio(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryRingRatio', null);
    },

    //上报机台
    async queryEachFactoryBoard(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryEachFactoryBoard', null);
    },
    //array厂电
    async queryArrayElec(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryArrayElec', null);
    },
    // array厂水
    async searchArrayWater(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/waterResult/searchArrayWater', null);
    },
    // array厂气
    async searchArrayGas(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/GasResult/searchArrayGas', null);
    },

    // el厂电
    async queryELElec(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryELElec', null);
    },
    // el厂水
    async searchELWater(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/waterResult/searchELWater', null);
    },
    //el气
    async searchElGas(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/GasResult/searchElGas', null);
    },
    //MOD电
    async queryMODElec(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryMODElec', null);
    },

    //文字概览
    async queryEnergy(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryEnergy', null);
    },

    //文字期数
    async queryForm(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryForm', null);
    },

    //文字期数
    async anomalyAnalysis(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/anomalyAnalysis', null);
    },
    //
    //异常分析  
    async queryEqIdEnergy(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryEqIdEnergy', null);
    },
    // 
    async queryEnergySpread(data) {
        return proposalJson.post(reportbaseApi2 + '/sys/RawData/queryEnergySpread', null);
    },
}